***                                                                                                                                                                                                                                                       
***                                                                                                                                                                                                                                                       
*** This Program already converted to Y2K                                                                                                                                                                                                                 
*** S&T Departement     on 29 April 1999 by Ben.Rahman                                                                                                                                                                                                    
***                                                                                                                                                                                                                                                       
***                                                                                                                                                                                                                                                       
set cent on                                                                                                                                                                                                                                               
SET PROC TO RDOCSUM                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                          
@08,03 CLEA TO 22,78                                                                                                                                                                                                                                      
@10,10 SAY 'SUMMARY REPORT OF THE NUMBER OF PATIENTS SEEN PER DOCTOR'                                                                                                                                                                                     
@12,10 SAY 'DOCTOR CODE :     TO    '                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                          
STOR SPAC(3) TO cCode1, cCode2                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                          
DO WHIL .T.                                                                                                                                                                                                                                               
   @12,24 GET cCode1                                                                                                                                                                                                                                      
   READ                                                                                                                                                                                                                                                   
   IF cCode1 = SPAC(3)                                                                                                                                                                                                                                    
      EXIT                                                                                                                                                                                                                                                
   ENDI                                                                                                                                                                                                                                                   
   @12,31 GET cCode2                                                                                                                                                                                                                                      
   READ                                                                                                                                                                                                                                                   
   IF cCode2 = SPAC(3)                                                                                                                                                                                                                                    
      EXIT                                                                                                                                                                                                                                                
   ENDI                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                          
   svconf = SAVESCREEN(00,00,24,79)                                                                                                                                                                                                                       
   SET COLO TO W+/N,W+/R                                                                                                                                                                                                                                  
   @14,24 CLEA TO 16,45                                                                                                                                                                                                                                   
   @14,24 TO 16,45 DOUBLE                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                          
   @15,25 PROMPT 'PRINT'                                                                                                                                                                                                                                  
   @15,30 SAY '/'                                                                                                                                                                                                                                         
   @15,31 PROMPT 'CANCELL'                                                                                                                                                                                                                                
   @15,38 SAY '/'                                                                                                                                                                                                                                         
   @15,39 PROMPT 'ESCAPE'                                                                                                                                                                                                                                 
   MENU TO nJw                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                          
   SET COLO TO W/B,W+/BG                                                                                                                                                                                                                                  
   RESTSCREEN(00,00,24,79,svconf)                                                                                                                                                                                                                         
   DO CASE                                                                                                                                                                                                                                                
      CASE nJw = 1                                                                                                                                                                                                                                        
         DO PDOCSUM                                                                                                                                                                                                                                       
         EXIT                                                                                                                                                                                                                                             
      CASE nJw = 2                                                                                                                                                                                                                                        
         LOOP                                                                                                                                                                                                                                             
      CASE nJw = 3                                                                                                                                                                                                                                        
         EXIT                                                                                                                                                                                                                                             
   ENDC                                                                                                                                                                                                                                                   
ENDD                                                                                                                                                                                                                                                      
SET COLO TO W/N,W/N                                                                                                                                                                                                                                       
CLEA                                                                                                                                                                                                                                                      
CLOS ALL                                                                                                                                                                                                                                                  
RETU                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                          
PROC PDOCSUM                                                                                                                                                                                                                                              
*-----------                                                                                                                                                                                                                                              
*         1         2         3         4         5         6         7         8         9         0         1         2         3         4         5         6                                                                                         
*123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890                                                                                                                                 
*                          SUMMARY OF THE NUMBER OF PATIENTS SEEN PER DOCTOR                              DATE : 99/99/9999                                                                                                                               
*                                                                                                         PAGE : 9,999                                                                                                                                    
*========================================================================================================================                                                                                                                                 
*CODE NAME                1      2      3      4      5      6      7      8      9     10     11     12     YTD      AVG                                                                                                                                 
*========================================================================================================================                                                                                                                                 
*XXX  X----------X X 99,999 99,999 99,999 99,999 99,999 99,999 99,999 99,999 99,999 99,999 99,999 99,999 999,999 99,999.9                                                                                                                                 
                                                                                                                                                                                                                                                          
@13,25 SAY 'Processing...'                                                                                                                                                                                                                                
DR1 = 'N:'                                                                                                                                                                                                                                                
DR2 = 'N:'                                                                                                                                                                                                                                                
F1  = 'ACT_PROY'                                                                                                                                                                                                                                          
F2  = 'TEMP_PRO'                                                                                                                                                                                                                                          
F3  = 'DOCTORS'                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                          
SET EXCLU OFF                                                                                                                                                                                                                                             
USE &DR1&F1                                                                                                                                                                                                                                               
COPY STRU TO &DR1&F2                                                                                                                                                                                                                                      
USE                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                          
cDate1 = '01/01/'+SUBS(STR(YEAR(DATE()),4),3,2)                                                                                                                                                                                                           
cDate2 = '31/12/'+SUBS(STR(YEAR(DATE()),4),3,2)                                                                                                                                                                                                           
dDate1 = CTOD(cDate1)                                                                                                                                                                                                                                     
dDate2 = CTOD(cDate2)                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                          
SET EXCLU OFF                                                                                                                                                                                                                                             
USE &DR1&F2                                                                                                                                                                                                                                               
APPE FROM &DR1&F1 FOR (DATE_VISIT >= dDate1) .AND. (DATE_VISIT <= dDate2);                                                                                                                                                                                
     .AND. (DOC_CODE >= cCode1) .AND. (DOC_CODE <= cCode2)                                                                                                                                                                                                
INDE ON DOC_CODE+DTOS(DATE_VISIT)+PAT_FILCOD TO &DR1&F2                                                                                                                                                                                                   
USE                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                          
@13,25 SAY 'Printing...  '                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                          
SELE 1                                                                                                                                                                                                                                                    
SET EXCLU OFF                                                                                                                                                                                                                                             
USE &DR1&F2 INDE &DR1&F2                                                                                                                                                                                                                                  
SELE 2                                                                                                                                                                                                                                                    
SET EXCLU OFF                                                                                                                                                                                                                                             
*USE &DR2&F3 INDE &DR2&F3                                                                                                                                                                                                                                 
USE &DR2&F3                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                          
SET PRIN ON                                                                                                                                                                                                                                               
SET DEVI TO PRIN                                                                                                                                                                                                                                          
?CHR(15)                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                          
SELE 1                                                                                                                                                                                                                                                    
GO BOTT                                                                                                                                                                                                                                                   
nMonav = MONTH(DATE_VISIT)                                                                                                                                                                                                                                
GO TOP                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                          
SELE 1                                                                                                                                                                                                                                                    
STOR 0 TO nHal, nBrs, nQty1, nQty2, nQty3, nBl11, nBl12, nBl13, nBl21, nBl22,;                                                                                                                                                                            
     nBl23, nBl31, nBl32, nBl33, nBl41, nBl42, nBl43, nBl51, nBl52, nBl53,;                                                                                                                                                                               
     nBl61, nBl62, nBl63, nBl71, nBl72, nBl73, nBl81, nBl82, nBl83, nBl91,;                                                                                                                                                                               
     nBl92, nBl93, nBl101, nBl102, nBl103, nBl111, nBl112, nBl113, nBl121,;                                                                                                                                                                               
     nBl122, nBl123, nYtd1, nYtd2, nYtd3, nAvg1, nAvg2, nAvg3, nTbl1, nTbl2,;                                                                                                                                                                             
     nTbl3, nTbl4, nTbl5, nTbl6, nTbl7, nTbl8, nTbl9, nTbl10, nTbl011, nTbl012,;                                                                                                                                                                          
     nTytd, nTbl11, nTbl12, nTbl13, nTbl21, nTbl22, nTbl23, nTbl31, nTbl32,;                                                                                                                                                                              
     nTbl33, nTbl41, nTbl42, nTbl43, nTbl51, nTbl52, nTbl53, nTbl61, nTbl62,;                                                                                                                                                                             
     nTbl63, nTbl71, nTbl72, nTbl73, nTbl81, nTbl82, nTbl83, nTbl91, nTbl92,;                                                                                                                                                                             
     nTbl93, nTbl101, nTbl102, nTbl103, nTbl111, nTbl112, nTbl113, nTbl121,;                                                                                                                                                                              
     nTbl122, nTbl123, nYtd11, nTytd1, nTytd2, nTytd3, nTavg1, nTavg2, nTavg3,;                                                                                                                                                                           
     nTavg                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                          
DO HDRDOSUM                                                                                                                                                                                                                                               
DO WHIL .NOT. EOF()                                                                                                                                                                                                                                       
   cCode = DOC_CODE                                                                                                                                                                                                                                       
   STOR 0 TO nBl11, nBl12, nBl13, nBl21, nBl22, nBl23, nBl31,nBl32, nBl33,;                                                                                                                                                                               
        nBl41, nBl42, nBl43, nBl51, nBl52, nBl53, nBl61, nBl62, nBl63, nBl71,;                                                                                                                                                                            
        nBl72, nBl73, nBl81, nBl82, nBl83, nBl91, nBl92, nBl93, nBl101, nBl102,;                                                                                                                                                                          
        nBl103, nBl111, nBl112, nBl113, nBl121, nBl122, nBl123, nYtd1, nYtd2,;                                                                                                                                                                            
        nYtd3, nAvg1, nAvg2, nAvg3                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                          
   SELE 2                                                                                                                                                                                                                                                 
*   SEEK cCode                                                                                                                                                                                                                                            
    LOCAT FOR DOC_CODE=CCODE .AND. .NOT. EOF()                                                                                                                                                                                                            
   IF .NOT. EOF()                                                                                                                                                                                                                                         
      cName = DOC_ALIAS                                                                                                                                                                                                                                   
   ELSE                                                                                                                                                                                                                                                   
      cName = SPAC(12)                                                                                                                                                                                                                                    
   ENDI                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                          
   SELE 1                                                                                                                                                                                                                                                 
   DO WHIL (DOC_CODE = cCode) .AND. .NOT. EOF()                                                                                                                                                                                                           
      nMon  = MONTH(DATE_VISIT)                                                                                                                                                                                                                           
      STOR 0 TO nQty1, nQty2, nQty3                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                          
      DO WHIL (DOC_CODE = cCode) .AND. (MONTH(DATE_VISIT) = nMon) .AND. .NOT. EOF()                                                                                                                                                                       
         cPatcod = PAT_FILCOD                                                                                                                                                                                                                             
         cPcotyp = PAT_CODTYP                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                          
         DO WHIL (DOC_CODE = cCode) .AND. (MONTH(DATE_VISIT) = nMon) .AND.;                                                                                                                                                                               
         (PAT_FILCOD = cPatcod) .AND. .NOT. EOF()                                                                                                                                                                                                         
            SKIP                                                                                                                                                                                                                                          
         ENDD                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                          
         IF cPcotyp = '0' .OR. cPcotyp = '9'                                                                                                                                                                                                              
            nQty1  = nQty1 + 1                                                                                                                                                                                                                            
         ELSE                                                                                                                                                                                                                                             
            IF cPcotyp = '6'                                                                                                                                                                                                                              
               nQty2  = nQty2 + 1                                                                                                                                                                                                                         
            ELSE                                                                                                                                                                                                                                          
               nQty3  = nQty3 + 1                                                                                                                                                                                                                         
            ENDI                                                                                                                                                                                                                                          
         ENDI                                                                                                                                                                                                                                             
      ENDD                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                          
      nYtd1 = nYtd1 + nQty1                                                                                                                                                                                                                               
      nYtd2 = nYtd2 + nQty3                                                                                                                                                                                                                               
      nYtd3 = nYtd3 + nQty2                                                                                                                                                                                                                               
      nTytd = nTytd + nQty1 + nQty2 + nQty3                                                                                                                                                                                                               
                                                                                                                                                                                                                                                          
      DO CASE                                                                                                                                                                                                                                             
         CASE nMon = 1                                                                                                                                                                                                                                    
            nBl11   = nQty1                                                                                                                                                                                                                               
            nBl12   = nQty3                                                                                                                                                                                                                               
            nBl13   = nQty2                                                                                                                                                                                                                               
            nTbl11  = nTbl11 + nQty1                                                                                                                                                                                                                      
            nTbl12  = nTbl12 + nQty3                                                                                                                                                                                                                      
            nTbl13  = nTbl13 + nQty2                                                                                                                                                                                                                      
            nTbl1   = nTbl1 + nBl11 + nBl12 + nBl13                                                                                                                                                                                                       
         CASE nMon = 2                                                                                                                                                                                                                                    
            nBl21   = nQty1                                                                                                                                                                                                                               
            nBl22   = nQty3                                                                                                                                                                                                                               
            nBl23   = nQty2                                                                                                                                                                                                                               
            nTbl21  = nTbl21 + nQty1                                                                                                                                                                                                                      
            nTbl22  = nTbl22 + nQty3                                                                                                                                                                                                                      
            nTbl23  = nTbl23 + nQty2                                                                                                                                                                                                                      
            nTbl2   = nTbl2 + nBl21 + nBl22 + nBl23                                                                                                                                                                                                       
         CASE nMon = 3                                                                                                                                                                                                                                    
            nBl31   = nQty1                                                                                                                                                                                                                               
            nBl32   = nQty3                                                                                                                                                                                                                               
            nBl33   = nQty2                                                                                                                                                                                                                               
            nTbl31  = nTbl31 + nQty1                                                                                                                                                                                                                      
            nTbl32  = nTbl32 + nQty3                                                                                                                                                                                                                      
            nTbl33  = nTbl33 + nQty2                                                                                                                                                                                                                      
            nTbl3   = nTbl3 + nBl31 + nBl32 + nBl33                                                                                                                                                                                                       
         CASE nMon = 4                                                                                                                                                                                                                                    
            nBl41   = nQty1                                                                                                                                                                                                                               
            nBl42   = nQty3                                                                                                                                                                                                                               
            nBl43   = nQty2                                                                                                                                                                                                                               
            nTbl41  = nTbl41 + nQty1                                                                                                                                                                                                                      
            nTbl42  = nTbl42 + nQty3                                                                                                                                                                                                                      
            nTbl43  = nTbl43 + nQty2                                                                                                                                                                                                                      
            nTbl4   = nTbl4 + nBl41 + nBl42 + nBl43                                                                                                                                                                                                       
         CASE nMon = 5                                                                                                                                                                                                                                    
            nBl51   = nQty1                                                                                                                                                                                                                               
            nBl52   = nQty3                                                                                                                                                                                                                               
            nBl53   = nQty2                                                                                                                                                                                                                               
            nTbl51  = nTbl51 + nQty1                                                                                                                                                                                                                      
            nTbl52  = nTbl52 + nQty3                                                                                                                                                                                                                      
            nTbl53  = nTbl53 + nQty2                                                                                                                                                                                                                      
            nTbl5   = nTbl5 + nBl51 + nBl52 + nBl53                                                                                                                                                                                                       
         CASE nMon = 6                                                                                                                                                                                                                                    
            nBl61   = nQty1                                                                                                                                                                                                                               
            nBl62   = nQty3                                                                                                                                                                                                                               
            nBl63   = nQty2                                                                                                                                                                                                                               
            nTbl61  = nTbl61 + nQty1                                                                                                                                                                                                                      
            nTbl62  = nTbl62 + nQty3                                                                                                                                                                                                                      
            nTbl63  = nTbl63 + nQty2                                                                                                                                                                                                                      
            nTbl6   = nTbl6 + nBl61 + nBl62 + nBl63                                                                                                                                                                                                       
         CASE nMon = 7                                                                                                                                                                                                                                    
            nBl71   = nQty1                                                                                                                                                                                                                               
            nBl72   = nQty3                                                                                                                                                                                                                               
            nBl73   = nQty2                                                                                                                                                                                                                               
            nTbl71  = nTbl71 + nQty1                                                                                                                                                                                                                      
            nTbl72  = nTbl72 + nQty3                                                                                                                                                                                                                      
            nTbl73  = nTbl73 + nQty2                                                                                                                                                                                                                      
            nTbl7   = nTbl7 + nBl71 + nBl72 + nBl73                                                                                                                                                                                                       
         CASE nMon = 8                                                                                                                                                                                                                                    
            nBl81   = nQty1                                                                                                                                                                                                                               
            nBl82   = nQty3                                                                                                                                                                                                                               
            nBl83   = nQty2                                                                                                                                                                                                                               
            nTbl81  = nTbl81 + nQty1                                                                                                                                                                                                                      
            nTbl82  = nTbl82 + nQty3                                                                                                                                                                                                                      
            nTbl83  = nTbl83 + nQty2                                                                                                                                                                                                                      
            nTbl8   = nTbl8 + nBl81 + nBl82 + nBl83                                                                                                                                                                                                       
         CASE nMon = 9                                                                                                                                                                                                                                    
            nBl91   = nQty1                                                                                                                                                                                                                               
            nBl92   = nQty3                                                                                                                                                                                                                               
            nBl93   = nQty2                                                                                                                                                                                                                               
            nTbl91  = nTbl91 + nQty1                                                                                                                                                                                                                      
            nTbl92  = nTbl92 + nQty3                                                                                                                                                                                                                      
            nTbl93  = nTbl93 + nQty2                                                                                                                                                                                                                      
            nTbl9   = nTbl9 + nBl91 + nBl92 + nBl93                                                                                                                                                                                                       
         CASE nMon = 10                                                                                                                                                                                                                                   
            nBl101  = nQty1                                                                                                                                                                                                                               
            nBl102  = nQty3                                                                                                                                                                                                                               
            nBl103  = nQty2                                                                                                                                                                                                                               
            nTbl101 = nTbl101 + nQty1                                                                                                                                                                                                                     
            nTbl102 = nTbl102 + nQty3                                                                                                                                                                                                                     
            nTbl103 = nTbl103 + nQty2                                                                                                                                                                                                                     
            nTbl10  = nTbl10 + nBl101 + nBl102 + nBl103                                                                                                                                                                                                   
         CASE nMon = 11                                                                                                                                                                                                                                   
            nBl111  = nQty1                                                                                                                                                                                                                               
            nBl112  = nQty3                                                                                                                                                                                                                               
            nBl113  = nQty2                                                                                                                                                                                                                               
            nTbl111 = nTbl111 + nQty1                                                                                                                                                                                                                     
            nTbl112 = nTbl112 + nQty3                                                                                                                                                                                                                     
            nTbl113 = nTbl113 + nQty2                                                                                                                                                                                                                     
            nTbl011  = nTbl011 + nBl111 + nBl112 + nBl113                                                                                                                                                                                                 
         CASE nMon = 12                                                                                                                                                                                                                                   
            nBl121  = nQty1                                                                                                                                                                                                                               
            nBl122  = nQty3                                                                                                                                                                                                                               
            nBl123  = nQty2                                                                                                                                                                                                                               
            nTbl121 = nTbl121 + nQty1                                                                                                                                                                                                                     
            nTbl122 = nTbl122 + nQty3                                                                                                                                                                                                                     
            nTbl123 = nTbl123 + nQty2                                                                                                                                                                                                                     
            nTbl012  = nTbl012 + nBl121 + nBl122 + nBl123                                                                                                                                                                                                 
      ENDC                                                                                                                                                                                                                                                
   ENDD                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                          
   nAvg1 = nYtd1 / nMonav                                                                                                                                                                                                                                 
   nAvg2 = nYtd2 / nMonav                                                                                                                                                                                                                                 
   nAvg3 = nYtd3 / nMonav                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                          
   IF nBrs > 52                                                                                                                                                                                                                                           
      nBrs = nBrs + 2                                                                                                                                                                                                                                     
      @nBrs,01 SAY 'A = AEA Employee, B = Clients, C = Outsider'                                                                                                                                                                                          
      DO HDRDOSUM                                                                                                                                                                                                                                         
   ENDI                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                          
   @nBrs,01  SAY cCode                                                                                                                                                                                                                                    
   @nBrs,06  SAY cName                                                                                                                                                                                                                                    
   @nBrs,19  SAY 'A'                                                                                                                                                                                                                                      
   @nBrs,21  SAY nBl11  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,28  SAY nBl21  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,35  SAY nBl31  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,42  SAY nBl41  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,49  SAY nBl51  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,56  SAY nBl61  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,63  SAY nBl71  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,70  SAY nBl81  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,77  SAY nBl91  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,84  SAY nBl101 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,91  SAY nBl111 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,98  SAY nBl121 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,105 SAY nYtd1  PICT '999,999'                                                                                                                                                                                                                    
   @nBrs,113 SAY nAvg1  PICT '99,999.9'                                                                                                                                                                                                                   
   nBrs = nBrs + 1                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                          
   @nBrs,19  SAY 'B'                                                                                                                                                                                                                                      
   @nBrs,21  SAY nBl12  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,28  SAY nBl22  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,35  SAY nBl32  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,42  SAY nBl42  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,49  SAY nBl52  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,56  SAY nBl62  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,63  SAY nBl72  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,70  SAY nBl82  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,77  SAY nBl92  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,84  SAY nBl102 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,91  SAY nBl112 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,98  SAY nBl122 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,105 SAY nYtd2  PICT '999,999'                                                                                                                                                                                                                    
   @nBrs,113 SAY nAvg2  PICT '99,999.9'                                                                                                                                                                                                                   
   nBrs = nBrs + 1                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                          
   @nBrs,19  SAY 'C'                                                                                                                                                                                                                                      
   @nBrs,21  SAY nBl13  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,28  SAY nBl23  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,35  SAY nBl33  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,42  SAY nBl43  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,49  SAY nBl53  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,56  SAY nBl63  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,63  SAY nBl73  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,70  SAY nBl83  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,77  SAY nBl93  PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,84  SAY nBl103 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,91  SAY nBl113 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,98  SAY nBl123 PICT '99,999'                                                                                                                                                                                                                     
   @nBrs,105 SAY nYtd3  PICT '999,999'                                                                                                                                                                                                                    
   @nBrs,113 SAY nAvg3  PICT '99,999.9'                                                                                                                                                                                                                   
   nBrs = nBrs + 1                                                                                                                                                                                                                                        
ENDD                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                          
@nBrs,01   SAY '========================================================================================================================'                                                                                                                 
nBrs = nBrs + 1                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                          
nTytd1 = nTbl11+nTbl21+nTbl31+nTbl41+nTbl51+nTbl61+nTbl71+nTbl81+nTbl91+nTbl101+nTbl111+nTbl121                                                                                                                                                           
nTavg1 = nTytd1 / nMonav                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                          
@nBrs,19  SAY 'A'                                                                                                                                                                                                                                         
@nBrs,21  SAY nTbl11  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,28  SAY nTbl21  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,35  SAY nTbl31  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,42  SAY nTbl41  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,49  SAY nTbl51  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,56  SAY nTbl61  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,63  SAY nTbl71  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,70  SAY nTbl81  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,77  SAY nTbl91  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,84  SAY nTbl101 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,91  SAY nTbl111 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,98  SAY nTbl121 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,105 SAY nTytd1  PICT '999,999'                                                                                                                                                                                                                      
@nBrs,113 SAY nTavg1  PICT '99,999.9'                                                                                                                                                                                                                     
nBrs = nBrs + 1                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                          
nTytd2 = nTbl12+nTbl22+nTbl32+nTbl42+nTbl52+nTbl62+nTbl72+nTbl82+nTbl92+nTbl102+nTbl112+nTbl122                                                                                                                                                           
nTavg2 = nTytd2 / nMonav                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                          
@nBrs,19  SAY 'B'                                                                                                                                                                                                                                         
@nBrs,21  SAY nTbl12  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,28  SAY nTbl22  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,35  SAY nTbl32  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,42  SAY nTbl42  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,49  SAY nTbl52  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,56  SAY nTbl62  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,63  SAY nTbl72  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,70  SAY nTbl82  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,77  SAY nTbl92  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,84  SAY nTbl102 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,91  SAY nTbl112 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,98  SAY nTbl122 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,105 SAY nTytd2  PICT '999,999'                                                                                                                                                                                                                      
@nBrs,113 SAY nTavg2  PICT '99,999.9'                                                                                                                                                                                                                     
nBrs = nBrs + 1                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                          
nTytd3 = nTbl13+nTbl23+nTbl33+nTbl43+nTbl53+nTbl63+nTbl73+nTbl83+nTbl93+nTbl103+nTbl113+nTbl123                                                                                                                                                           
nTavg3 = nTytd3 / nMonav                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                          
@nBrs,19  SAY 'C'                                                                                                                                                                                                                                         
@nBrs,21  SAY nTbl13  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,28  SAY nTbl23  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,35  SAY nTbl33  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,42  SAY nTbl43  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,49  SAY nTbl53  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,56  SAY nTbl63  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,63  SAY nTbl73  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,70  SAY nTbl83  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,77  SAY nTbl93  PICT '99,999'                                                                                                                                                                                                                       
@nBrs,84  SAY nTbl103 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,91  SAY nTbl113 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,98  SAY nTbl123 PICT '99,999'                                                                                                                                                                                                                       
@nBrs,105 SAY nTytd3  PICT '999,999'                                                                                                                                                                                                                      
@nBrs,113 SAY nTavg3  PICT '99,999.9'                                                                                                                                                                                                                     
nBrs = nBrs + 1                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                          
nTavg  = nTytd / nMonav                                                                                                                                                                                                                                   
@nBrs,01   SAY 'T O T A L  :'                                                                                                                                                                                                                             
@nBrs,20   SAY nTbl1   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,27   SAY nTbl2   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,34   SAY nTbl3   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,41   SAY nTbl4   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,48   SAY nTbl5   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,55   SAY nTbl6   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,62   SAY nTbl7   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,69   SAY nTbl8   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,76   SAY nTbl9   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,83   SAY nTbl10  PICT '999,999'                                                                                                                                                                                                                     
@nBrs,90   SAY nTbl011 PICT '999,999'                                                                                                                                                                                                                     
@nBrs,97   SAY nTbl012 PICT '999,999'                                                                                                                                                                                                                     
@nBrs,105  SAY nTytd   PICT '999,999'                                                                                                                                                                                                                     
@nBrs,113  SAY nTavg   PICT '99,999.9'                                                                                                                                                                                                                    
nBrs = nBrs + 1                                                                                                                                                                                                                                           
@nBrs,01 SAY '========================================================================================================================'                                                                                                                   
nBrs = nBrs + 2                                                                                                                                                                                                                                           
@nBrs,01 SAY 'A = AEA Employee, B = Clients, C = Outsider'                                                                                                                                                                                                
?CHR(18)                                                                                                                                                                                                                                                  
SET PRIN OFF                                                                                                                                                                                                                                              
SET DEVI TO SCREE                                                                                                                                                                                                                                         
RETU                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                          
PROC HDRDOSUM                                                                                                                                                                                                                                             
*------------                                                                                                                                                                                                                                             
nHal = nHal + 1                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                          
@01,27  SAY 'SUMMARY OF THE NUMBER OF PATIENTS SEEN PER DOCTOR'                                                                                                                                                                                           
@01,106 SAY 'DATE :'                                                                                                                                                                                                                                      
@01,113 SAY DATE()                                                                                                                                                                                                                                        
@02,106  SAY 'PAGE :'                                                                                                                                                                                                                                     
@02,113 SAY nHal PICT '9,999'                                                                                                                                                                                                                             
@03,01  SAY '========================================================================================================================'                                                                                                                    
@04,01  SAY 'CODE NAME                1      2      3      4      5      6      7      8      9     10     11     12     YTD      AVG'                                                                                                                    
@05,01  SAY '========================================================================================================================'                                                                                                                    
nBrs = 7                                                                                                                                                                                                                                                  
RETU                                                                                                                                                                                                                                                      
